<template>
  <div class="app-account" id="app-account">
    <router-view></router-view>
    <t-background></t-background>
    <t-background-exchange></t-background-exchange>
  </div>
</template>

<script>
  import optimalAccountHeight from '@/app/utils/optimalAccountHeight';
  import tBackground from '@/components/background';
  import tBackgroundExchange from '@/components/background-exchange';
  
  export default {
    name: 'account',
    components: {
      tBackground,
      tBackgroundExchange,
    },
    created() {
      this.$eventHub.$on('resize', () => {
        this.optimal();
      });
    },
    mounted() {
      this.optimal();
    },
    activated() {
      this.optimal();
    },
    methods: {
      optimal() {
        this.$nextTick(() => {
          if (/^\/account/i.test(this.$route.path)) {
            optimalAccountHeight.run();
          }
        });
      },
    },
  };
</script>